﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DevDemo
{
    public partial class TestCustomizeControl : Form
    {
        public TestCustomizeControl()
        {
            InitializeComponent();
        }

        private void TestCustomizeControl_Load(object sender, EventArgs e)
        {
            #region demo1

            //Dictionary<string, string> dic = new Dictionary<string, string>();

            //dic.Add("1", "1");
            //dic.Add("2", "2");
            //dic.Add("3", "3");
            //dic.Add("4", "4");
            //dic.Add("5", "5");

            //string[] strArrType = { "T1", "T2", "T3", "T4", "T5" };//分类

            //int pianyi = 20;

            //foreach (var item in strArrType)
            //{
            //    var obj = new UC_GridList();

            //    obj.TypeTitle = item;

            //    obj.listArr = dic;

            //    obj.Location = new Point(pianyi, 20);

            //    this.Controls.Add(obj);

            //    pianyi += 210;
            //}

            //this.AutoScroll = true;

            #endregion

            #region demo2

            //var a = new UC_GridListByDev();

            //this.Controls.Add(a);

            #endregion

            #region demo3

            List<DrugClass> drugobjs = new List<DrugClass>();

            for (int i = 0; i < 10; i++)
            {
                drugobjs.Add(new DrugClass
                {
                    DrugID = "id" + i,
                    DrugName = "Name" + i,
                    Drug_Manufacturer = "[厂商" + i+"]",
                    Drug_Specification = "[100*10" + i+"]"
                });
            }

            int intx = 10;

            for (int i = 0; i < 4; i++)
            {
                var ob = new UC_DrugLists();

                ob.drugobjs = drugobjs;

                ob.TypeName = "精神治疗药物";

                ob.Location = new Point(intx, 10);

                this.Controls.Add(ob);

                intx += 200;
            }

            #endregion
        }
    }
}
